//
//  WmcEditNameVM.swift
//  YPWatermarkCamera
//
//  Created by 周诗松 on 2022/4/14.
//

import Foundation
import RxSwift
import YPNetwork

class WmcEditNameVM: WmcBaseVM {
    
    var updateData: (() -> Void)?
    
    func submit(name: String) -> Observable<YPNetworkResponse> {
        return WmcUserCenterAPI.updateNickname(name: name).do { response in
            WmcLoginManager.updateUserInfo(name: name) { isSuccess in
                self.updateData?()
            }
        }
    }
}
